/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.peifu;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import com.qihoo.gamecenter.sdk.common.d.a;
import com.qihoo.gamecenter.sdk.common.d.a.a;
import com.qihoo.gamecenter.sdk.common.web.view.WebViewer;
import com.qihoo.gamecenter.sdk.common.web.view.WebViewer.c;
import com.qihoo.gamecenter.sdk.pay.component.ProgressView;

public class WebPeiFu extends FrameLayout {
    private Activity a;
    private WebViewer b;
    private ProgressView c;
    private b d;

    public WebPeiFu(Activity paramActivity, b paramb) {
        super(paramActivity);
        this.a = paramActivity;
        this.d = paramb;
        c();
    }

    private void c() {
        this.c = new ProgressView(this.a);
        this.c.setBackgroundColor(Color.argb(80, 40, 40, 40));
        this.c.a(a.a(a.a.l));
        this.c.a();
        this.b = new WebViewer(this.a);
        this.b.setOnWebViewClient(new WebViewer.c() {
            public boolean b(WebView paramWebView, String paramString) {
                return false;
            }

            public void a(WebView paramWebView, int paramInt, String paramString1, String paramString2) {}

            public void a(WebView paramWebView, String paramString, Bitmap paramBitmap) {
                WebPeiFu.a(WebPeiFu.this).a();
            }

            public void a(WebView paramWebView, String paramString) {
                WebPeiFu.a(WebPeiFu.this).b();
                WebPeiFu.b(WebPeiFu.this).requestFocus();
            }
        });
        addView(this.b, new FrameLayout.LayoutParams(-1, -1));
        addView(this.c);
        this.b.addJavascriptInterface(new a(), "CallJavaObj");
        this.b.loadUrl("http://openbox.mobilem.360.cn/html/events/sdk/peifu.html ");
    }

    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        b();
    }

    public boolean a() {
        return this.b.goBack();
    }

    public void b() {
        this.b.destory();
    }

    public static abstract interface b {}

    public class a {}
}